package view;

import javax.swing.*;

import model.Book;
import model.Comment;
import model.Grade;
import model.Model;


import java.awt.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.Vector;


public class View extends JFrame {
	
	private JPanel panelNorth = new JPanel();
	private JPanel panelWest = new JPanel();
	private JPanel panelCenter1 = new JPanel();
	private JPanel panelCenter11 = new JPanel();
	private JPanel panelCenter12 = new JPanel();
	private JPanel panelCenter2 = new JPanel();
	private JPanel panelCenter3 = new JPanel();
	private JPanel panelEast = new JPanel();
	private JPanel panelSouth = new JPanel();
	private JPanel panelNorthHaut = new JPanel();
	private JPanel panelNorthBas = new JPanel();
	private JPanel panelCenterGauche = new JPanel();
	private JPanel panelCenterDroite = new JPanel();
	private JPanel panelCenterDroiteHaut = new JPanel();
	private JPanel panelCenterDroiteMilieu = new JPanel();
	private JPanel panelCenterDroiteHautHaut = new JPanel();
	private JPanel panelCenterDroiteHautBas = new JPanel();
	private JPanel panelCenterDroiteBas = new JPanel();
	private JPanel panelCenterDroiteBasScrollpane = new JPanel();
	
      
    private JLabel labelNorthHautGauche = new JLabel();
    private JLabel labelWest = new JLabel();
    private JLabel labelEast = new JLabel();
    private JLabel labelSouth = new JLabel();
    private JLabel labelBookInformation = new JLabel("Book information:");
    private JLabel labelBookTitle = new JLabel("Title:");
    private JLabel labelBookTitleVar = new JLabel("");
    private JLabel labelBookAuthor = new JLabel("Author:");
    private JLabel labelBookAuthorVar = new JLabel("");
    private JLabel labelBookPublishedYear = new JLabel("Published year:");
    private JLabel labelBookPublishedYearVar = new JLabel("");
    private JLabel labelGrade = new JLabel("Grade:");
    private JLabel labelGradeVar = new JLabel("");
    private JLabel labelComment = new JLabel("Comments:");
    
    private JLabel labelPanel3Title = new JLabel("");
    private JLabel labelCustomerName = new JLabel("");
    private JLabel labelCustomerNameVar = new JLabel("");
    private JLabel labelCustomerTel = new JLabel("");
    private JLabel labelCustomerTelVar = new JLabel("");
    private JLabel labelCustomerBirthdate = new JLabel("");
    private JLabel labelCustomerBirthdateVar = new JLabel("");
    
    private JLabel labelVide = new JLabel("");
    private JLabel labelTest1 = new JLabel("labelTest1");
    private JLabel labelTest2 = new JLabel("labelTest2");

    private JTextArea textAreaWikiData;
    private JScrollPane scrollPaneWikiData;
    
    private static JLabel dessinSouth;
    private final JScrollPane scrollPaneGauche = new JScrollPane();
    private final JScrollPane scrollPaneDroite = new JScrollPane();
    private ArrayList<JLabel> listLabelsAllBooks = new ArrayList<JLabel>();
    private ArrayList<JLabel> listLabelsAllComments = new ArrayList<JLabel>();
    private ArrayList<JButton> listButtonsAllComments = new ArrayList<JButton>();
    private JList<String> listJListAllBooks = new JList<String>();
    private Vector<String> listJListAllBooksVector = new Vector<String>();
    private Map<String, Integer> listAllBooksHashMap = new HashMap<String, Integer>();
    
    private JButton boutonDeco = new JButton("Log Out");
    private JButton boutonMenu1 = new JButton("Catalog");
    private JButton boutonMenu2 = new JButton("Books currently reserved");
    private JButton boutonMenu3 = new JButton("Personal Information");
    private JButton boutonGiveGrade = new JButton("Give a grade");
    private JButton boutonLeaveComment = new JButton("Leave a comment");
    private JButton boutonTest = new JButton("Test");
    
    private int currentBook;
    
    private Model m;
   
    
	public View(Model m) {
		
		this.m = m;
		
		setTitle("Library Manager");
	    setSize(600, 500);
	    //This will center the JFrame in the middle of the screen
	    setLocationRelativeTo(null);
	    setDefaultCloseOperation(EXIT_ON_CLOSE);
	    setDefaultLookAndFeelDecorated(true);
	    
	    setContentPane(new JLabel(new ImageIcon("wallpaperlibrarymanager.jpg")));
		BorderLayout bl = new BorderLayout();
        bl.setHgap(30);
        bl.setVgap(30);
        getContentPane().setLayout(bl);
        panelNorth.setLayout(new GridLayout(2,1));
        panelNorthHaut.setLayout(new FlowLayout());
        panelNorthBas.setLayout(new GridLayout(1,3));
        //GridBagLayout glCenter = new GridBagLayout();
        //panelCenter1.setLayout(glCenter);
        panelCenter1.setLayout(new FlowLayout());
        panelCenter11.setLayout(new GridLayout(1,2));
        panelCenter12.setLayout(new FlowLayout());
        panelCenter2.setLayout(new GridBagLayout());
        panelCenter3.setLayout(new GridBagLayout());
        panelCenterDroite.setLayout(new GridLayout(3,1));
        panelCenterDroiteHaut.setLayout(new GridBagLayout());
        panelCenterDroiteMilieu.setLayout(new GridBagLayout());
        panelCenterDroiteBas.setLayout(new GridBagLayout());
        GridBagConstraints c = new GridBagConstraints();
        
        dessinSouth = new JLabel (new ImageIcon("dessinSouth.png"));
        
        labelWest.setText("");
        labelEast.setText("");
        labelTest1.setText("label test 1");
        labelTest1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        labelTest2.setText("label test 2");
        labelTest2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        
        
        
        // The panels are transparent  
        panelNorth.setOpaque(false);
        panelWest.setOpaque(false);
        panelCenter1.setOpaque(false);
        panelCenter11.setOpaque(false);
        panelCenter12.setOpaque(false);
        panelCenter2.setOpaque(false);
        panelCenter3.setOpaque(false);
        panelNorthHaut.setOpaque(false);
        panelNorthBas.setOpaque(false);
        panelEast.setOpaque(false);
        panelSouth.setOpaque(false);
        
    	panelCenterGauche.setOpaque(false);
    	panelCenterDroite.setOpaque(false);
    	panelCenterDroiteHaut.setOpaque(false);
    	panelCenterDroiteMilieu.setOpaque(false);
    	panelCenterDroiteHautHaut.setOpaque(false);
    	panelCenterDroiteHautBas.setOpaque(false);
    	panelCenterDroiteBas.setOpaque(false);
    	panelCenterDroiteBasScrollpane.setOpaque(false);
        
        
    	Font police = new Font("SegoeUI", Font.PLAIN, 14);
        labelNorthHautGauche.setText("Library Manager");
        labelNorthHautGauche.setFont(police);
        labelNorthHautGauche.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
               
        panelNorthHaut.add(labelNorthHautGauche);
        panelNorthHaut.add(boutonDeco);
        panelNorthBas.add(boutonMenu1);
        panelNorthBas.add(boutonMenu2);
        panelNorthBas.add(boutonMenu3);
        
    	panelNorth.add(panelNorthHaut);
    	panelNorth.add(panelNorthBas);
    	    
        panelWest.add(labelWest);
        
        
        
        //--------------------------------------------------------------------------------------------
        //----------------------------   CREATION DE PANELCENTER1   ----------------------------------
        //--------------------------------------------------------------------------------------------
        
        // Creation of the books' list (labels)
        Set cles = m.getMapBooks().keySet();
        Iterator it = cles.iterator();
        while (it.hasNext()){
        	Object cle = it.next();
        	Book valeur = m.getMapBooks().get(cle);
        	listAllBooksHashMap.put(valeur.displayString(), valeur.getIdBook());
        }

        cles = listAllBooksHashMap.keySet();
        it = cles.iterator();
        while (it.hasNext()){
           Object cle = it.next();
           listJListAllBooksVector.add(cle.toString());
        }
        listJListAllBooks.setListData(listJListAllBooksVector);
        panelCenterGauche.add(listJListAllBooks);
        
        panelCenterGauche.setOpaque(true);
        panelCenterGauche.setBackground(Color.WHITE);
        scrollPaneGauche.setViewportView(panelCenterGauche);
        scrollPaneGauche.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scrollPaneGauche.getViewport().setOpaque(false);
        panelCenter11.add(scrollPaneGauche);
        
        
        
        
        
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        c.gridx = 0;
        c.gridy = 0;
        c.insets = new Insets(0,0,10,0);
        panelCenterDroiteHaut.add(labelBookInformation, c);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 0.5;
        c.gridx = 0;
        c.gridy = 1;
        c.insets = new Insets(0,20,0,0);
        panelCenterDroiteHaut.add(labelBookTitle, c);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 0.5;
        c.gridx = 1;
        c.gridy = 1;
        c.insets = new Insets(0,0,0,0);
        panelCenterDroiteHaut.add(labelBookTitleVar, c);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 0.5;
        c.gridx = 0;
        c.gridy = 2;
        c.insets = new Insets(0,20,0,0);
        panelCenterDroiteHaut.add(labelBookAuthor, c);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 0.5;
        c.gridx = 1;
        c.gridy = 2;
        c.insets = new Insets(0,0,0,0);
        panelCenterDroiteHaut.add(labelBookAuthorVar, c);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 0.5;
        c.gridx = 0;
        c.gridy = 3;
        c.insets = new Insets(0,20,0,0);
        panelCenterDroiteHaut.add(labelBookPublishedYear, c);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 0.5;
        c.gridx = 1;
        c.gridy = 3;
        c.insets = new Insets(0,0,0,0);
        panelCenterDroiteHaut.add(labelBookPublishedYearVar, c);
        panelCenterDroite.add(panelCenterDroiteHaut);
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        c.gridx = 0;
        c.gridy = 0;
        c.gridwidth = 3;
        c.insets = new Insets(0,0,10,0);
        panelCenterDroiteMilieu.add(labelGrade, c);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        c.gridx = 0;
        c.gridy = 1;
        c.insets = new Insets(0,20,0,0);
        panelCenterDroiteMilieu.add(labelGradeVar, c);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 0.0;
        c.gridx = 2;
        c.gridy = 2;
        c.insets = new Insets(0,200,0,0);
        c.anchor = GridBagConstraints.LINE_END;
        panelCenterDroiteMilieu.add(boutonGiveGrade, c);
        panelCenterDroite.add(panelCenterDroiteMilieu);
        
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 0.5;
        c.gridx = 0;
        c.gridy = 0;
        c.insets = new Insets(0,0,10,0);
        panelCenterDroiteBas.add(labelComment, c);
        
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1;
        c.gridx = 0;
        c.gridy = 1;
        c.ipady = 40;
        c.insets = new Insets(0,20,0,0);
        panelCenterDroiteBasScrollpane.setOpaque(true);
        panelCenterDroiteBasScrollpane.setBackground(Color.WHITE);
        scrollPaneDroite.setViewportView(panelCenterDroiteBasScrollpane);
        scrollPaneDroite.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scrollPaneDroite.getViewport().setOpaque(false);
        panelCenterDroiteBas.add(scrollPaneDroite, c);
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1;
        c.gridx = 2;
        c.gridy = 2;
        c.ipady = 0;
        c.insets = new Insets(0,200,0,0);
        panelCenterDroiteBas.add(boutonLeaveComment, c);
        panelCenterDroiteBas.add(labelVide, c);
        panelCenterDroite.add(panelCenterDroiteBas);
        
        panelCenter11.add(panelCenterDroite);
        
        

        textAreaWikiData = new JTextArea(20, 30);
        scrollPaneWikiData = new JScrollPane(textAreaWikiData); 
        scrollPaneWikiData.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scrollPaneWikiData.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        textAreaWikiData.setEditable(false);
        textAreaWikiData.setLineWrap(true);
        panelCenter12.add(scrollPaneWikiData);
        
        panelCenter1.add(panelCenter11);
        panelCenter1.add(panelCenter12);
        
        
        
        //--------------------------------------------------------------------------------------------
        //----------------------------   CREATION DE PANELCENTER2   ----------------------------------
        //--------------------------------------------------------------------------------------------
        
        
        
        
        //--------------------------------------------------------------------------------------------
        //----------------------------   CREATION DE PANELCENTER3   ----------------------------------
        //--------------------------------------------------------------------------------------------
        
        c = new GridBagConstraints();
        
        labelPanel3Title.setText("Customer's information:");
        labelCustomerName.setText("Name:");
        labelCustomerNameVar.setText("");
        labelCustomerTel.setText("Tel:");
        labelCustomerTelVar.setText("");
        labelCustomerBirthdate.setText("Birthdate:");
        labelCustomerBirthdateVar.setText("");
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        c.gridx = 0;
        c.gridy = 0;
        c.insets = new Insets(0,0,10,0);
        panelCenter3.add(labelPanel3Title, c);
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        c.gridx = 0;
        c.gridy = 1;
        c.insets = new Insets(0,20,0,0);
        panelCenter3.add(labelCustomerName, c);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        c.gridx = 1;
        c.gridy = 1;
        c.insets = new Insets(0,0,0,0);
        panelCenter3.add(labelCustomerNameVar, c);
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        c.gridx = 0;
        c.gridy = 2;
        c.insets = new Insets(0,20,0,0);
        panelCenter3.add(labelCustomerTel, c);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        c.gridx = 1;
        c.gridy = 2;
        c.insets = new Insets(0,0,0,0);
        panelCenter3.add(labelCustomerTelVar, c);
        
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        c.gridx = 0;
        c.gridy = 3;
        c.insets = new Insets(0,20,0,0);
        panelCenter3.add(labelCustomerBirthdate, c);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        c.gridx = 1;
        c.gridy = 3;
        c.insets = new Insets(0,0,0,0);
        panelCenter3.add(labelCustomerBirthdateVar, c);
        
        
        //--------------------------------------------------------------------------------------------
        //-------------------------   FIN DE CREATION DES PANELCENTER   ------------------------------
        //--------------------------------------------------------------------------------------------
        
        
        
        panelEast.add(labelEast);
        panelSouth.add(labelSouth);
        
        
        
        
        
        getContentPane().add(panelNorth,BorderLayout.NORTH);
        getContentPane().add(panelWest,BorderLayout.WEST);
        getContentPane().add(panelCenter1,BorderLayout.CENTER);
        getContentPane().add(panelEast,BorderLayout.EAST);
        getContentPane().add(panelSouth,BorderLayout.SOUTH);

        pack();
        setVisible(true);
        
        currentBook = -1;
	}
	
	public void changeBookInfo(String item){
		
		panelCenterDroiteBasScrollpane.removeAll();
		
		//Gestion des informations du livre
		Integer value = listAllBooksHashMap.get(item);
		currentBook = value;
		labelBookTitleVar.setText(m.getMapBooks().get(value).getTitle());
		labelBookAuthorVar.setText(m.getMapBooks().get(value).getAuthor());
		labelBookPublishedYearVar.setText(m.getMapBooks().get(value).getPublishedYear().toString());
		
		
		//Gestion de la note
		Double gradeTemp = 0.0;
		Double gradeTotal = 0.0;
		Integer nbGrades = 0;

		Set cles = m.getMapGrades().keySet();
        Iterator it = cles.iterator();
        while (it.hasNext()){
           Object cle = it.next();
           Grade valeur = m.getMapGrades().get(cle);

           if(valeur.getIdBook() == currentBook){
        	   gradeTemp += valeur.getGrade();
        	   nbGrades++;
           }
        }
        gradeTemp = round(gradeTemp, 2, BigDecimal.ROUND_HALF_UP);
        if(nbGrades != 0){
     	   gradeTotal = gradeTemp/nbGrades;
        }
        gradeTotal = round(gradeTotal, 2, BigDecimal.ROUND_HALF_UP);
        labelGradeVar.setText(gradeTotal.toString() + " / 10        -       " + nbGrades + " grades");
		
		//Gestion des commentaires
		m.updateArrayListCommentsDisplayed(value);
		displayComments(m.getArraylistCommentsDisplayed());
		
		//Get data from Wikipedia
		textAreaWikiData.setText(m.getWikiData(m.getMapBooks().get(value).getTitleWikipedia()));
	}
	
	public static double round(double unrounded, int precision, int roundingMode)
	{
	    BigDecimal bd = new BigDecimal(unrounded);
	    BigDecimal rounded = bd.setScale(precision, roundingMode);
	    return rounded.doubleValue();
	}
	
	public void displayComments(ArrayList<Comment> arraylistComments){
		
		listLabelsAllComments.clear();
		
		for(int i=0; i<arraylistComments.size(); i++) {
        	JLabel labelTemp = new JLabel();
        	String customerName = m.getMapCustomers().get(arraylistComments.get(i).getIdCustomer()).getName();
        	labelTemp.setText(customerName + " - " + arraylistComments.get(i).getCommentText());
        	listLabelsAllComments.add(labelTemp);
        }
        panelCenterDroiteBasScrollpane.setLayout(new GridLayout(listLabelsAllComments.size(),1));
        for(int i=0; i<listLabelsAllComments.size(); i++) {
        	panelCenterDroiteBasScrollpane.add(listLabelsAllComments.get(i));
        }
	}
		
	public ViewPopupComment openPopupComment(){
		
		ViewPopupComment viewPopupComment = new ViewPopupComment(this, m, currentBook);
		viewPopupComment.setLocationRelativeTo(this);
		viewPopupComment.setVisible(true);
				
		return viewPopupComment;
	}
	
	public ViewPopupGrade openPopupGrade(){
		
		ViewPopupGrade viewPopupGrade = new ViewPopupGrade(this, m, currentBook);
		viewPopupGrade.setLocationRelativeTo(this);
		viewPopupGrade.setVisible(true);
				
		return viewPopupGrade;
	}

	public JPanel getPanelNorth() {
		return panelNorth;
	}

	public void setPanelNorth(JPanel panelNorth) {
		this.panelNorth = panelNorth;
	}

	public JPanel getPanelWest() {
		return panelWest;
	}

	public void setPanelWest(JPanel panelWest) {
		this.panelWest = panelWest;
	}

	public JPanel getPanelCenter1() {
		return panelCenter1;
	}

	public void setPanelCenter1(JPanel panelCenter1) {
		this.panelCenter1 = panelCenter1;
	}

	public JPanel getPanelCenter11() {
		return panelCenter11;
	}

	public void setPanelCenter11(JPanel panelCenter11) {
		this.panelCenter11 = panelCenter11;
	}

	public JPanel getPanelCenter12() {
		return panelCenter12;
	}

	public void setPanelCenter12(JPanel panelCenter12) {
		this.panelCenter12 = panelCenter12;
	}

	public JPanel getPanelCenter2() {
		return panelCenter2;
	}

	public void setPanelCenter2(JPanel panelCenter2) {
		this.panelCenter2 = panelCenter2;
	}

	public JPanel getPanelCenter3() {
		return panelCenter3;
	}

	public void setPanelCenter3(JPanel panelCenter3) {
		this.panelCenter3 = panelCenter3;
	}

	public JPanel getPanelEast() {
		return panelEast;
	}

	public void setPanelEast(JPanel panelEast) {
		this.panelEast = panelEast;
	}

	public JPanel getPanelSouth() {
		return panelSouth;
	}

	public void setPanelSouth(JPanel panelSouth) {
		this.panelSouth = panelSouth;
	}

	public JPanel getPanelNorthHaut() {
		return panelNorthHaut;
	}

	public void setPanelNorthHaut(JPanel panelNorthHaut) {
		this.panelNorthHaut = panelNorthHaut;
	}

	public JPanel getPanelNorthBas() {
		return panelNorthBas;
	}

	public void setPanelNorthBas(JPanel panelNorthBas) {
		this.panelNorthBas = panelNorthBas;
	}

	public JPanel getPanelCenterGauche() {
		return panelCenterGauche;
	}

	public void setPanelCenterGauche(JPanel panelCenterGauche) {
		this.panelCenterGauche = panelCenterGauche;
	}

	public JPanel getPanelCenterDroite() {
		return panelCenterDroite;
	}

	public void setPanelCenterDroite(JPanel panelCenterDroite) {
		this.panelCenterDroite = panelCenterDroite;
	}

	public JPanel getPanelCenterDroiteHaut() {
		return panelCenterDroiteHaut;
	}

	public void setPanelCenterDroiteHaut(JPanel panelCenterDroiteHaut) {
		this.panelCenterDroiteHaut = panelCenterDroiteHaut;
	}

	public JPanel getPanelCenterDroiteMilieu() {
		return panelCenterDroiteMilieu;
	}

	public void setPanelCenterDroiteMilieu(JPanel panelCenterDroiteMilieu) {
		this.panelCenterDroiteMilieu = panelCenterDroiteMilieu;
	}

	public JPanel getPanelCenterDroiteHautHaut() {
		return panelCenterDroiteHautHaut;
	}

	public void setPanelCenterDroiteHautHaut(JPanel panelCenterDroiteHautHaut) {
		this.panelCenterDroiteHautHaut = panelCenterDroiteHautHaut;
	}

	public JPanel getPanelCenterDroiteHautBas() {
		return panelCenterDroiteHautBas;
	}

	public void setPanelCenterDroiteHautBas(JPanel panelCenterDroiteHautBas) {
		this.panelCenterDroiteHautBas = panelCenterDroiteHautBas;
	}

	public JPanel getPanelCenterDroiteBas() {
		return panelCenterDroiteBas;
	}

	public void setPanelCenterDroiteBas(JPanel panelCenterDroiteBas) {
		this.panelCenterDroiteBas = panelCenterDroiteBas;
	}

	public JPanel getPanelCenterDroiteBasScrollpane() {
		return panelCenterDroiteBasScrollpane;
	}

	public void setPanelCenterDroiteBasScrollpane(
			JPanel panelCenterDroiteBasScrollpane) {
		this.panelCenterDroiteBasScrollpane = panelCenterDroiteBasScrollpane;
	}

	public JLabel getLabelNorthHautGauche() {
		return labelNorthHautGauche;
	}

	public void setLabelNorthHautGauche(JLabel labelNorthHautGauche) {
		this.labelNorthHautGauche = labelNorthHautGauche;
	}

	public JLabel getLabelWest() {
		return labelWest;
	}

	public void setLabelWest(JLabel labelWest) {
		this.labelWest = labelWest;
	}

	public JLabel getLabelEast() {
		return labelEast;
	}

	public void setLabelEast(JLabel labelEast) {
		this.labelEast = labelEast;
	}

	public JLabel getLabelSouth() {
		return labelSouth;
	}

	public void setLabelSouth(JLabel labelSouth) {
		this.labelSouth = labelSouth;
	}

	public JLabel getLabelBookInformation() {
		return labelBookInformation;
	}

	public void setLabelBookInformation(JLabel labelBookInformation) {
		this.labelBookInformation = labelBookInformation;
	}

	public JLabel getLabelBookTitle() {
		return labelBookTitle;
	}

	public void setLabelBookTitle(JLabel labelBookTitle) {
		this.labelBookTitle = labelBookTitle;
	}

	public JLabel getLabelBookTitleVar() {
		return labelBookTitleVar;
	}

	public void setLabelBookTitleVar(JLabel labelBookTitleVar) {
		this.labelBookTitleVar = labelBookTitleVar;
	}

	public JLabel getLabelBookAuthor() {
		return labelBookAuthor;
	}

	public void setLabelBookAuthor(JLabel labelBookAuthor) {
		this.labelBookAuthor = labelBookAuthor;
	}

	public JLabel getLabelBookAuthorVar() {
		return labelBookAuthorVar;
	}

	public void setLabelBookAuthorVar(JLabel labelBookAuthorVar) {
		this.labelBookAuthorVar = labelBookAuthorVar;
	}

	public JLabel getLabelBookPublishedYear() {
		return labelBookPublishedYear;
	}

	public void setLabelBookPublishedYear(JLabel labelBookPublishedYear) {
		this.labelBookPublishedYear = labelBookPublishedYear;
	}

	public JLabel getLabelBookPublishedYearVar() {
		return labelBookPublishedYearVar;
	}

	public void setLabelBookPublishedYearVar(JLabel labelBookPublishedYearVar) {
		this.labelBookPublishedYearVar = labelBookPublishedYearVar;
	}

	public JLabel getLabelGrade() {
		return labelGrade;
	}

	public void setLabelGrade(JLabel labelGrade) {
		this.labelGrade = labelGrade;
	}

	public JLabel getLabelGradeVar() {
		return labelGradeVar;
	}

	public void setLabelGradeVar(JLabel labelGradeVar) {
		this.labelGradeVar = labelGradeVar;
	}

	public JLabel getLabelComment() {
		return labelComment;
	}

	public void setLabelComment(JLabel labelComment) {
		this.labelComment = labelComment;
	}

	public JLabel getLabelPanel3Title() {
		return labelPanel3Title;
	}

	public void setLabelPanel3Title(JLabel labelPanel3Title) {
		this.labelPanel3Title = labelPanel3Title;
	}

	public JLabel getLabelCustomerName() {
		return labelCustomerName;
	}

	public void setLabelCustomerName(JLabel labelCustomerName) {
		this.labelCustomerName = labelCustomerName;
	}

	public JLabel getLabelCustomerNameVar() {
		return labelCustomerNameVar;
	}

	public void setLabelCustomerNameVar(JLabel labelCustomerNameVar) {
		this.labelCustomerNameVar = labelCustomerNameVar;
	}

	public JLabel getLabelCustomerTel() {
		return labelCustomerTel;
	}

	public void setLabelCustomerTel(JLabel labelCustomerTel) {
		this.labelCustomerTel = labelCustomerTel;
	}

	public JLabel getLabelCustomerTelVar() {
		return labelCustomerTelVar;
	}

	public void setLabelCustomerTelVar(JLabel labelCustomerTelVar) {
		this.labelCustomerTelVar = labelCustomerTelVar;
	}

	public JLabel getLabelCustomerBirthdate() {
		return labelCustomerBirthdate;
	}

	public void setLabelCustomerBirthdate(JLabel labelCustomerBirthdate) {
		this.labelCustomerBirthdate = labelCustomerBirthdate;
	}

	public JLabel getLabelCustomerBirthdateVar() {
		return labelCustomerBirthdateVar;
	}

	public void setLabelCustomerBirthdateVar(JLabel labelCustomerBirthdateVar) {
		this.labelCustomerBirthdateVar = labelCustomerBirthdateVar;
	}

	public JLabel getLabelVide() {
		return labelVide;
	}

	public void setLabelVide(JLabel labelVide) {
		this.labelVide = labelVide;
	}

	public JLabel getLabelTest1() {
		return labelTest1;
	}

	public void setLabelTest1(JLabel labelTest1) {
		this.labelTest1 = labelTest1;
	}

	public JLabel getLabelTest2() {
		return labelTest2;
	}

	public void setLabelTest2(JLabel labelTest2) {
		this.labelTest2 = labelTest2;
	}

	public JTextArea getTextAreaWikiData() {
		return textAreaWikiData;
	}

	public void setTextAreaWikiData(JTextArea textAreaWikiData) {
		this.textAreaWikiData = textAreaWikiData;
	}

	public JScrollPane getScrollPaneWikiData() {
		return scrollPaneWikiData;
	}

	public void setScrollPaneWikiData(JScrollPane scrollPaneWikiData) {
		this.scrollPaneWikiData = scrollPaneWikiData;
	}

	public static JLabel getDessinSouth() {
		return dessinSouth;
	}

	public static void setDessinSouth(JLabel dessinSouth) {
		View.dessinSouth = dessinSouth;
	}

	public ArrayList<JLabel> getListLabelsAllBooks() {
		return listLabelsAllBooks;
	}

	public void setListLabelsAllBooks(ArrayList<JLabel> listLabelsAllBooks) {
		this.listLabelsAllBooks = listLabelsAllBooks;
	}

	public ArrayList<JLabel> getListLabelsAllComments() {
		return listLabelsAllComments;
	}

	public void setListLabelsAllComments(ArrayList<JLabel> listLabelsAllComments) {
		this.listLabelsAllComments = listLabelsAllComments;
	}

	public ArrayList<JButton> getListButtonsAllComments() {
		return listButtonsAllComments;
	}

	public void setListButtonsAllComments(ArrayList<JButton> listButtonsAllComments) {
		this.listButtonsAllComments = listButtonsAllComments;
	}

	public JList<String> getListJListAllBooks() {
		return listJListAllBooks;
	}

	public void setListJListAllBooks(JList<String> listJListAllBooks) {
		this.listJListAllBooks = listJListAllBooks;
	}

	public Vector<String> getListJListAllBooksVector() {
		return listJListAllBooksVector;
	}

	public void setListJListAllBooksVector(Vector<String> listJListAllBooksVector) {
		this.listJListAllBooksVector = listJListAllBooksVector;
	}

	public Map<String, Integer> getListAllBooksHashMap() {
		return listAllBooksHashMap;
	}

	public void setListAllBooksHashMap(Map<String, Integer> listAllBooksHashMap) {
		this.listAllBooksHashMap = listAllBooksHashMap;
	}

	public JButton getBoutonDeco() {
		return boutonDeco;
	}

	public void setBoutonDeco(JButton boutonDeco) {
		this.boutonDeco = boutonDeco;
	}

	public JButton getBoutonMenu1() {
		return boutonMenu1;
	}

	public void setBoutonMenu1(JButton boutonMenu1) {
		this.boutonMenu1 = boutonMenu1;
	}

	public JButton getBoutonMenu2() {
		return boutonMenu2;
	}

	public void setBoutonMenu2(JButton boutonMenu2) {
		this.boutonMenu2 = boutonMenu2;
	}

	public JButton getBoutonMenu3() {
		return boutonMenu3;
	}

	public void setBoutonMenu3(JButton boutonMenu3) {
		this.boutonMenu3 = boutonMenu3;
	}

	public JButton getBoutonGiveGrade() {
		return boutonGiveGrade;
	}

	public void setBoutonGiveGrade(JButton boutonGiveGrade) {
		this.boutonGiveGrade = boutonGiveGrade;
	}

	public JButton getBoutonLeaveComment() {
		return boutonLeaveComment;
	}

	public void setBoutonLeaveComment(JButton boutonLeaveComment) {
		this.boutonLeaveComment = boutonLeaveComment;
	}

	public JButton getBoutonTest() {
		return boutonTest;
	}

	public void setBoutonTest(JButton boutonTest) {
		this.boutonTest = boutonTest;
	}

	public int getCurrentBook() {
		return currentBook;
	}

	public void setCurrentBook(int currentBook) {
		this.currentBook = currentBook;
	}

	public Model getM() {
		return m;
	}

	public void setM(Model m) {
		this.m = m;
	}

	public JScrollPane getScrollPaneGauche() {
		return scrollPaneGauche;
	}

	public JScrollPane getScrollPaneDroite() {
		return scrollPaneDroite;
	}
	
	
	
	
	
	
	
}
